import jakarta.servlet.*;
import jakarta.servlet.http.*;
import jakarta.servlet.annotation.*;

import java.io.IOException;
import java.io.PrintWriter;

@WebServlet(name = "UserInfo", value = "/UserInfo")
public class UserInfo extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("GBK");
        response.setContentType("text/html;charset=GBK");
        PrintWriter out = response.getWriter();
        out.println("您的账号是："+request.getParameter("username"));
        out.println("您的密码是："+request.getParameter("userpassword"));
        out.println("您的性别是："+request.getParameter("usersex"));
        out.println("您的兴趣是：");
        String[] userIns = request.getParameterValues("userIns");
        if(userIns!=null){
            for(int i=0;i<userIns.length;i++){
                out.println(userIns[i]);
            }
        }
        else{
            out.println("没有兴趣");
        }
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
